/*
 * @(#)MaintDmsDocumentForm.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.dms.web;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;

import com.dcivision.dms.DmsOperationConstant;
import com.dcivision.dms.bean.DmsDocument;
import com.dcivision.dms.bean.DmsDocumentDetail;
import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.GlobalConstant;
import com.dcivision.framework.SystemParameterConstant;
import com.dcivision.framework.SystemParameterFactory;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.Utility;
import com.dcivision.framework.bean.AbstractBaseObject;

/**
  MaintDmsDocumentForm.java

  This class is the for web form purpose.

  @author          Zoe Shum
  @company         DCIVision Limited
  @creation date   05/08/2003
  @version         $Revision: 1.61 $
*/

public class MaintDmsDocumentForm  extends com.dcivision.setup.web.AbstractActionPermissionForm implements com.dcivision.framework.web.WorkflowActionFormInterface {

  public static final String REVISION = "$Revision: 1.61 $";

  private String documentName = null;
  private String documentType = null;
  private String parentID = null;
  private String rootID = null;
  private String priority = GlobalConstant.PRIORITY_MEDIUM;
  private String createType = null;
  private String effectiveStartDate = null;
  private String effectiveEndDate = null;
  private String reminderAmount = null;
  private String reminderType = null;
  private String[] notificationWay = null;
  private String ownerID = null;
  private String referenceNo = null;
  private String description = null;
  private String itemSize = null;
  private String itemStatus = null;
  private String trueFileName = null;
  private String closeFlag = null;
  //Document Content
  private FormFile uploadFile =null;

  //Upload dmsDocument by email
  private String emailAttachment = null;
  private String attachmentIndex = null;
  private String mailServer = null;
  private String loginName = null;
  private String password = null;

  /** Holds value of property User Defined Index. */
  private String userDefinedFieldID = null;
  private List documentDetails = new ArrayList();
  private List udfDetailList = new ArrayList();

  private String checkoutID = null;
  private String alertEditID = null;
  private String alertInviteID = null;
  private String userDef1 = null;
  private String userDef2 = null;
  private String userDef3 = null;
  private String userDef4 = null;
  private String userDef5 = null;
  private String userDef6 = null;
  private String userDef7 = null;
  private String userDef8 = null;
  private String userDef9 = null;
  private String userDef10 = null;

  /**Varibles to display the notification ways for alert in summarg page */
  private String actionTypeA=null;
  private String actionTypeI=null;
  private String notifyWayA=null;
  private String notifyWayI=null;

  private boolean bClearLogs=false;
  private String dueDate = null;
  private String message=null;
  private int noOfVersion=0;
  private String alertType=null;
  private String[] userList=null;
  private String[] groupList=null;
  private String[] roleList=null;
  private String userDefinedType=null;

  /** Information for document copy */
  private String targetRootID = null;
  private String destinationID = null;
  private String destinationPath = null;
  private String curFunctionCode = null;
  private String copyFileOpt = DmsOperationConstant.COPY_OPERATION_AS_OLD;
  private String copyVersionOpt = DmsOperationConstant.COPY_ALL_VERSIONS;
  private String copyStructureOnly = DmsOperationConstant.NO_STRUCTURE_COPY;

  /** Document Upload index */
  private FormFile scanFile = null;
  private FormFile fullTextFile = null;
  
  /** based on scan folder structure */
  private String scanSupportFolderStructure = null ; 

  /** Document file name before rename */
  private String oldName = null;
  private String changeExt = "N";

  /** Workflow Routine Fields */
  private String submitSystemWorkflow = null;
  private String sysWorkflowCategoryID = null;
  private String workflowRecordID = null;
  private String workflowComment = null;
  private String trackID = null;

  /** for compound doc, to indicate where the function call from*/
  private String parentModule = null;
  private boolean bCreatePhysicalFile = true;
  
  private String fileNames = null;
  private String dmsFileNames = null;
  private String displayFileNames = null;
  private String displayDmsFileNames = null;
  private String nextStepDueDates = null;
  private String nextStepAllowAssignDueDate = null;
  protected String pageOffset = SystemParameterFactory.getSystemParameter(SystemParameterConstant.PAGE_OFF_SET);
  protected String curStartRowNo = "1";
  protected String sortAttribute = "updateDate";
  protected String sortOrder = "DESC";
  
  /** for reference file , to indicate where the function call from*/
  private String returnTo = null;
  
  /** for return button to find the navigation */
  private String directURL=null;
  
  private String showTree = null;
  
    /** this property is just for odma */
  private FormFile formFieldXmlFile =null;
  
  private String clientType = null;
  
  /** for workflow, copied doc id */
  private Integer copiedDocID;
  
  private boolean bClearIndex=false;  
  
  private String clearIndexFlag="";

  private String editIndexFlag="";  
  
  private String useDefaultProfile = "";  
  
  private String inheritanceFlag = GlobalConstant.TRUE;
  
  private String objectID = null;
  
  private String objectType = null;  
  
  private String permission = null;  
  
  private String setPermission = null;
  
  private String errorScanFormat = null;
  
  public MaintDmsDocumentForm() {
    super();
  }

  public String getDocumentName() {
    return(this.documentName);
  }

  public void setDocumentName(String documentName) {
    this.documentName = documentName;
  }

  public String getDocumentType() {
    return(this.documentType);
  }

  public void setDocumentType(String documentType) {
    this.documentType = documentType;
  }

  public String getParentID() {
    return(this.parentID);
  }

  public void setParentID(String parentID) {
    this.parentID = parentID;
  }

  public String getRootID() {
    return(this.rootID);
  }

  public void setRootID(String rootID) {
    this.rootID = rootID;
  }

  public String getPriority() {
    return(this.priority);
  }

  public void setPriority(String priority) {
    this.priority = priority;
  }

  public String getCreateType() {
    return(this.createType);
  }

  public void setCreateType(String createType) {
    this.createType = createType;
  }

  public String getEffectiveStartDate() {
    return(this.effectiveStartDate);
  }

  public void setEffectiveStartDate(String effectiveStartDate) {
    this.effectiveStartDate = effectiveStartDate;
  }

  public String getEffectiveEndDate() {
    return(this.effectiveEndDate);
  }

  public void setEffectiveEndDate(String effectiveEndDate) {
    this.effectiveEndDate = effectiveEndDate;
  }

  public String getReminderAmount() {
    return (this.reminderAmount);
  }

  public void setReminderAmount(String reminderAmount) {
    this.reminderAmount = reminderAmount;
  }

  public String getReminderType() {
    return (this.reminderType);
  }

  public void setReminderType(String reminderType) {
    this.reminderType = reminderType;
  }

  public String[] getNotificationWay() {
    return (this.notificationWay);
  }

  public void setNotificationWay(String[] notificationWay){
    this.notificationWay = notificationWay;
  }

  public String getOwnerID() {
    return(this.ownerID);
  }

  public void setOwnerID(String ownerID) {
    this.ownerID = ownerID;
  }

  public String getReferenceNo() {
    return(this.referenceNo);
  }

  public void setReferenceNo(String referenceNo) {
    this.referenceNo = referenceNo;
  }

  public String getDescription() {
    return(this.description);
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public String getItemSize() {
    return(this.itemSize);
  }

  public void setItemSize(String itemSize) {
    this.itemSize = itemSize;
  }

  public String getItemStatus() {
    return(this.itemStatus);
  }

  public void setItemStatus(String itemStatus) {
    this.itemStatus = itemStatus;
  }

  public void setTrueFileName(String trueFileName) {
      this.trueFileName = trueFileName;
  }

  public String getTrueFileName() {
      return trueFileName;
  }

  public void setCloseFlag(String closeFlag) {
      this.closeFlag = closeFlag;
  }

  public String getCloseFlag() {
      return closeFlag;
  }

  public void setEmailAttachment(String emailAttachment) {
    this.emailAttachment = emailAttachment;
  }

  public String getEmailAttachment() {
    return emailAttachment;
  }

  public void setAttachmentIndex(String attachmentIndex) {
    this.attachmentIndex = attachmentIndex;
  }

  public String getAttachmentIndex() {
      return attachmentIndex;
  }

  public void setUploadFile(FormFile uploadFile) {
    this.uploadFile = uploadFile;
  }

  public FormFile getUploadFile() {
    return uploadFile;
  }

  public void setMailServer(String mailServer) {
    this.mailServer = mailServer;
  }

  public String getMailServer() {
      return mailServer;
  }

  public void setLoginName(String loginName) {
    this.loginName = loginName;
  }

  public String getLoginName() {
      return loginName;
  }

  public void setPassword(String password) {
    this.password = password;
  }

  public String getPassword() {
      return password;
  }

  //for user defined field
  public void setUserDefinedFieldID(String userDefinedFieldID) {
      this.userDefinedFieldID = userDefinedFieldID;
  }

  public String getUserDefinedFieldID() {
      return userDefinedFieldID;
  }

  public void setDocumentDetails(List documentDetails) {
      this.documentDetails = documentDetails;
  }

  public List getDocumentDetails() {
      return documentDetails;
  }

  public List getUdfDetailList() {
  return(this.udfDetailList);
  }

  public void setUdfDetailList(List udfDetailList) {
    this.udfDetailList = udfDetailList;
  }

  public String getCheckoutID() {
    return(this.checkoutID);
  }

  public void setCheckoutID(String checkoutID) {
    this.checkoutID = checkoutID;
  }

  public String getAlertEditID() {
    return(this.alertEditID);
  }

  public void setAlertEditID(String alertEditID) {
    this.alertEditID = alertEditID;
  }

  public String getAlertInviteID() {
    return(this.alertInviteID);
  }

  public void setAlertInviteID(String alertInviteID) {
    this.alertInviteID = alertInviteID;
  }

  public String getUserDef1() {
    return(this.userDef1);
  }

  public void setUserDef1(String userDef1) {
    this.userDef1 = userDef1;
  }

  public String getUserDef2() {
    return(this.userDef2);
  }

  public void setUserDef2(String userDef2) {
    this.userDef2 = userDef2;
  }

  public String getUserDef3() {
    return(this.userDef3);
  }

  public void setUserDef3(String userDef3) {
    this.userDef3 = userDef3;
  }

  public String getUserDef4() {
    return(this.userDef4);
  }

  public void setUserDef4(String userDef4) {
    this.userDef4 = userDef4;
  }

  public String getUserDef5() {
    return(this.userDef5);
  }

  public void setUserDef5(String userDef5) {
    this.userDef5 = userDef5;
  }

  public String getUserDef6() {
    return(this.userDef6);
  }

  public void setUserDef6(String userDef6) {
    this.userDef6 = userDef6;
  }

  public String getUserDef7() {
    return(this.userDef7);
  }

  public void setUserDef7(String userDef7) {
    this.userDef7 = userDef7;
  }

  public String getUserDef8() {
    return(this.userDef8);
  }

  public void setUserDef8(String userDef8) {
    this.userDef8 = userDef8;
  }

  public String getUserDef9() {
    return(this.userDef9);
  }

  public void setUserDef9(String userDef9) {
    this.userDef9 = userDef9;
  }

  public String getUserDef10() {
    return(this.userDef10);
  }

  public void setUserDef10(String userDef10) {
    this.userDef10 = userDef10;
  }

  public void setDestinationID(String destinationID) {
      this.destinationID = destinationID;
  }

  public String getDestinationID() {
      return destinationID;
  }

  public void setTargetRootID(String targetRootID) {
      this.targetRootID = targetRootID;
  }

  public String getTargetRootID() {
    return targetRootID;
  }

  public void setDestinationPath(String destinationPath) {
    this.destinationPath = destinationPath;
  }

  public String getDestinationPath() {
    return destinationPath;
  }

  public void setCurFunctionCode(String curFunctionCode) {
    this.curFunctionCode = curFunctionCode;
  }

  public String getCurFunctionCode() {
    return curFunctionCode;
  }

  public void setCopyFileOpt(String copyFileOpt) {
    this.copyFileOpt = copyFileOpt;
  }

  public String getCopyFileOpt() {
    return copyFileOpt;
  }

  public void setCopyVersionOpt(String copyVersionOpt) {
    this.copyVersionOpt = copyVersionOpt;
  }

  public String getCopyVersionOpt() {
    return copyVersionOpt;
  }

  public void setCopyStructureOnly(String copyStructureOnly) {
    this.copyStructureOnly = copyStructureOnly;
  }

  public String getCopyStructureOnly() {
    return copyStructureOnly;
  }

  public void setScanFile(FormFile scanFile) {
    this.scanFile = scanFile;
  }

  public FormFile getScanFile() {
    return(this.scanFile);
  }

  public void setFullTextFile(FormFile fullTextFile) {
    this.fullTextFile = fullTextFile;
  }

  public FormFile getFullTextFile() {
    return(this.fullTextFile);
  }

  public void setOldName(String oldName) {
    this.oldName = oldName;
  }

  public String getOldName() {
    return (this.oldName);
  }
  public void setActionTypeA(String actionTypeA) {
   this.actionTypeA = actionTypeA;
 }

 public String getActionTypeA() {
   return (this.actionTypeA);
 }

 public void setActionTypeI(String actionTypeI) {
   this.actionTypeI = actionTypeI;
 }

 public String getActionTypeI() {
   return (this.actionTypeI);
 }


 public boolean getClearLogs(){
    return this.bClearLogs;
  }

  public void setClearLogs(boolean bClearLogs){
    this.bClearLogs=bClearLogs;
  }

  public String getNotifyWayA(){
    return this.notifyWayA;
  }

  public void setNotifyWayA(String notifyWayA){
    this.notifyWayA=notifyWayA;
  }

  public String getNotifyWayI(){
    return this.notifyWayI;
  }

  public void setNotifyWayI(String notifyWayI){
    this.notifyWayI=notifyWayI;
  }


  public String getDueDate() {
    return(this.dueDate);
  }

  public void setDueDate(String dueDate) {
    this.dueDate = dueDate;
  }

  public String getMessage() {
    return(this.message);
  }

  public void setMessage(String message) {
    this.message = message;
  }

  public int getNoOfVersion() {
    return(this.noOfVersion);
  }

  public void setNoOfVersion(int noOfVersion) {
    this.noOfVersion = noOfVersion;
  }

  public String getAlertType() {
    return(this.alertType);
  }

  public void setAlertType(String alertType) {
    this.alertType = alertType;
  }

  public String[] getUserList(){
    return this.userList;
  }

  public void setUserList(String[] userList){
    this.userList=userList;
  }

  public String[] getGroupList(){
    return this.groupList;
  }

  public void setGroupList(String[] groupList){
    this.groupList=groupList;
  }

  public String[] getRoleList(){
    return this.roleList;
  }

  public void setRoleList(String[] roleList){
    this.roleList=roleList;
  }

  public String getUserDefinedType(){
    return this.userDefinedType;
  }

  public void setUserDefinedType(String userDefinedType){
    this.userDefinedType=userDefinedType;
  }

  public void setChangeExt(String changeExt) {
    this.changeExt = changeExt;
  }

  public String getChangeExt() {
    return (this.changeExt);
  }

  public void setParentModule(String parentModule){
    this.parentModule = parentModule;
  }

  public String getParentModule(){
    return(this.parentModule);
  }

  public void setCreatePhysicalFile(boolean createPhysicalFile){
    this.bCreatePhysicalFile = createPhysicalFile;
  }

  public boolean getCreatePhysicalFile(){
    return this.bCreatePhysicalFile;
  }
  
  public void setDirectURL(String directURL){
    this.directURL=directURL; 
  }
  
  public String getDirectURL(){
    return this.directURL; 
  }
  
  public void setShowTree(String showTree){
    this.showTree=showTree; 
  }
  
  public String getShowTree(){
    return this.showTree; 
  }
  
  public void setScanSupportFolderStructure(String scanSupportFolderStructure){
    this.scanSupportFolderStructure =  scanSupportFolderStructure;
  }
  
  public String getScanSupportFolderStructure(){
    return this.scanSupportFolderStructure;
  }

  public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    this.setDocumentDetailsList(request);
    return super.validate(mapping, request);
  }

  public void reset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);
    this.setID(null);
    this.setDocumentName(null);
    this.setDocumentType(null);
    this.setParentID(null);
    this.setRootID(null);
    this.setPriority(GlobalConstant.PRIORITY_MEDIUM);
    this.setCreateType(null);
    this.setEffectiveStartDate(null);
    this.setEffectiveEndDate(null);
    this.setReminderAmount(null);
    this.setReminderType(null);
    this.setNotificationWay(null);
    this.setOwnerID(null);
    this.setReferenceNo(null);
    this.setDescription(null);
    this.setItemSize(null);
    this.setItemStatus(null);
    this.setTrueFileName(null);
    this.setRecordStatus(null);
    this.setUpdateCount(null);
    this.setCreatorID(null);
    this.setCreateDate(null);
    this.setUpdaterID(null);
    this.setUpdateDate(null);
    this.setEmailAttachment(null);
    this.setAttachmentIndex(null);
    this.setUploadFile(null);
    this.setUserDefinedFieldID(null);
    this.setDocumentDetails(null);
    this.setUdfDetailList(null);
    this.setCheckoutID(null);
    this.setAlertEditID(null);
    this.setAlertInviteID(null);
    this.setUserDef1(null);
    this.setUserDef2(null);
    this.setUserDef3(null);
    this.setUserDef4(null);
    this.setUserDef5(null);
    this.setUserDef6(null);
    this.setUserDef7(null);
    this.setUserDef8(null);
    this.setUserDef9(null);
    this.setUserDef10(null);
    this.setInheritanceFlag(null);   
  }

  public void OpReset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);
    this.setID(null);
    this.setDocumentName(null);
    //this.setDocumentType(null);
    //this.setParentID(null);
    //this.setRootID(null);
    this.setPriority(null);
    this.setCreateType(null);
    this.setEffectiveStartDate(null);
    this.setEffectiveEndDate(null);
    this.setReminderAmount(null);
    this.setReminderType(null);
    this.setNotificationWay(null);
    this.setOwnerID(null);
    this.setReferenceNo(null);
    this.setDescription(null);
    this.setItemSize(null);
    this.setItemStatus(null);
    this.setTrueFileName(null);
    this.setRecordStatus(null);
    this.setUpdateCount(null);
    //this.setCreatorID(null);
    //this.setCreateDate(null);
    //this.setUpdaterID(null);
    //this.setUpdateDate(null);
    this.setEmailAttachment(null);
    this.setAttachmentIndex(null);
    this.setUploadFile(null);
    this.setUserDefinedFieldID(null);
    this.setDocumentDetails(null);
    this.setUdfDetailList(null);
    this.setCheckoutID(null);
    this.setAlertEditID(null);
    this.setAlertInviteID(null);
    this.setUserDef1(null);
    this.setUserDef2(null);
    this.setUserDef3(null);
    this.setUserDef4(null);
    this.setUserDef5(null);
    this.setUserDef6(null);
    this.setUserDef7(null);
    this.setUserDef8(null);
    this.setUserDef9(null);
    this.setUserDef10(null);
  }

  public AbstractBaseObject getFormData() throws ApplicationException {
    DmsDocument tmpDmsDocument = new DmsDocument();
    tmpDmsDocument.setID(TextUtility.parseIntegerObj(this.getID()));
    tmpDmsDocument.setDocumentName(this.getDocumentName());
    tmpDmsDocument.setDocumentType(this.getDocumentType());
    tmpDmsDocument.setParentID(TextUtility.parseIntegerObj(this.getParentID()));
    tmpDmsDocument.setRootID(TextUtility.parseIntegerObj(this.getRootID()));
    tmpDmsDocument.setPriority(this.getPriority());
    tmpDmsDocument.setCreateType(this.getCreateType());
    tmpDmsDocument.setEffectiveStartDate(parseTimestamp(this.getEffectiveStartDate()));
    tmpDmsDocument.setEffectiveEndDate(parseTimestamp(this.getEffectiveEndDate()));
    tmpDmsDocument.setReminderAmount(TextUtility.parseIntegerObj(this.getReminderAmount()));
    tmpDmsDocument.setReminderType(this.getReminderType());
    tmpDmsDocument.setNotificationWay(this.getNotificationWay());
    tmpDmsDocument.setOwnerID(TextUtility.parseIntegerObj(this.getOwnerID()));
    tmpDmsDocument.setUserDefinedFieldID(TextUtility.parseIntegerObj(this.getUserDefinedFieldID()));
    tmpDmsDocument.setReferenceNo(this.getReferenceNo());
    tmpDmsDocument.setDescription(this.getDescription());
    tmpDmsDocument.setItemSize(TextUtility.parseIntegerObj(this.getItemSize()));
    tmpDmsDocument.setItemStatus(this.getItemStatus());
    tmpDmsDocument.setRecordStatus(this.getRecordStatus());
    tmpDmsDocument.setCurFunctionCode(this.getCurFunctionCode());
    tmpDmsDocument.setUpdateCount(TextUtility.parseIntegerObj(this.getUpdateCount()));
    tmpDmsDocument.setCreatorID(TextUtility.parseIntegerObj(this.getCreatorID()));
    tmpDmsDocument.setCreateDate(parseTimestamp(this.getCreateDate()));
    tmpDmsDocument.setUpdaterID(TextUtility.parseIntegerObj(this.getUpdaterID()));
    tmpDmsDocument.setUpdateDate(parseTimestamp(this.getUpdateDate()));
    if (udfDetailList!=null) {
      tmpDmsDocument.setUdfDetailList(this.udfDetailList);
    }
    tmpDmsDocument.setCheckoutID(TextUtility.parseIntegerObj(this.getCheckoutID()));
    tmpDmsDocument.setAlertEditID(TextUtility.parseIntegerObj(this.getAlertEditID()));
    tmpDmsDocument.setAlertInviteID(TextUtility.parseIntegerObj(this.getAlertInviteID()));
    tmpDmsDocument.setUserDef1(this.getUserDef1());
    tmpDmsDocument.setUserDef2(this.getUserDef2());
    tmpDmsDocument.setUserDef3(this.getUserDef3());
    tmpDmsDocument.setUserDef4(this.getUserDef4());
    tmpDmsDocument.setUserDef5(this.getUserDef5());
    tmpDmsDocument.setUserDef6(this.getUserDef6());
    tmpDmsDocument.setUserDef7(this.getUserDef7());
    tmpDmsDocument.setUserDef8(this.getUserDef8());
    tmpDmsDocument.setUserDef9(this.getUserDef9());
    tmpDmsDocument.setUserDef10(this.getUserDef10());
    tmpDmsDocument.setCreatePhysicalFile(this.getCreatePhysicalFile());
    return tmpDmsDocument;
  }

  public void setFormData(AbstractBaseObject baseObj) throws ApplicationException {
    DmsDocument tmpDmsDocument = (DmsDocument)baseObj;
    this.setID(TextUtility.formatIntegerObj(tmpDmsDocument.getID()));
    this.setDocumentName(tmpDmsDocument.getDocumentName());
    this.setDocumentType(tmpDmsDocument.getDocumentType());
    this.setParentID(TextUtility.formatIntegerObj(tmpDmsDocument.getParentID()));
    this.setRootID(TextUtility.formatIntegerObj(tmpDmsDocument.getRootID()));
    this.setPriority(tmpDmsDocument.getPriority());
    this.setCreateType(tmpDmsDocument.getCreateType());
    this.setEffectiveStartDate(formatTimestamp(tmpDmsDocument.getEffectiveStartDate()));
    this.setEffectiveEndDate(formatTimestamp(tmpDmsDocument.getEffectiveEndDate()));
    this.setReminderAmount(TextUtility.formatIntegerObj(tmpDmsDocument.getReminderAmount()));
    if (tmpDmsDocument.getReminderAmount()!=null && !Utility.isEmpty(tmpDmsDocument.getReminderType()) 
        && tmpDmsDocument.getReminderType().indexOf(";")==-1){
      String tmpReminder = tmpDmsDocument.getReminderAmount() + ";" + tmpDmsDocument.getReminderType();
      this.setReminderType(tmpReminder);
    }
    this.setNotificationWay(tmpDmsDocument.getNotificationWay());
    this.setOwnerID(TextUtility.formatIntegerObj(tmpDmsDocument.getOwnerID()));
    this.setUserDefinedFieldID(TextUtility.formatIntegerObj(tmpDmsDocument.getUserDefinedFieldID()));
    this.setReferenceNo(tmpDmsDocument.getReferenceNo());
    this.setDescription(tmpDmsDocument.getDescription());
    this.setItemSize(TextUtility.formatIntegerObj(tmpDmsDocument.getItemSize()));
    this.setItemStatus(tmpDmsDocument.getItemStatus());
    this.setCheckoutID(TextUtility.formatIntegerObj(tmpDmsDocument.getCheckoutID()));
    this.setAlertEditID(TextUtility.formatIntegerObj(tmpDmsDocument.getAlertEditID()));
    this.setAlertInviteID(TextUtility.formatIntegerObj(tmpDmsDocument.getAlertInviteID()));
    this.setRecordStatus(tmpDmsDocument.getRecordStatus());
    this.setUpdateCount(TextUtility.formatIntegerObj(tmpDmsDocument.getUpdateCount()));
    this.setCreatorID(TextUtility.formatIntegerObj(tmpDmsDocument.getCreatorID()));
    this.setCreateDate(formatTimestamp(tmpDmsDocument.getCreateDate()));
    this.setUpdaterID(TextUtility.formatIntegerObj(tmpDmsDocument.getUpdaterID()));
    this.setUpdateDate(formatTimestamp(tmpDmsDocument.getUpdateDate()));
    this.setUserDef1(tmpDmsDocument.getUserDef1());
    this.setUserDef2(tmpDmsDocument.getUserDef2());
    this.setUserDef3(tmpDmsDocument.getUserDef3());
    this.setUserDef4(tmpDmsDocument.getUserDef4());
    this.setUserDef5(tmpDmsDocument.getUserDef5());
    this.setUserDef6(tmpDmsDocument.getUserDef6());
    this.setUserDef7(tmpDmsDocument.getUserDef7());
    this.setUserDef8(tmpDmsDocument.getUserDef8());
    this.setUserDef9(tmpDmsDocument.getUserDef9());
    this.setUserDef10(tmpDmsDocument.getUserDef10());
    this.setCreatePhysicalFile(tmpDmsDocument.getCreatePhysicalFile());
  }

  public void setFormData(AbstractBaseObject baseObj, List docDetailList) throws ApplicationException {
    this.setFormData(baseObj);
    if (docDetailList!=null && docDetailList.size() > 0) {
      //get the first one
      this.setUserDefinedFieldID(String.valueOf(((DmsDocumentDetail)docDetailList.get(0)).getUserDefinedFieldID()));
    }
    this.setDocumentDetails(docDetailList);
  }

  public void setDocumentDetailsList(HttpServletRequest request) {
    java.util.List docDetailsList = new java.util.ArrayList();
    this.setDocumentDetails(docDetailsList);
  }

  public String getSubmitSystemWorkflow() {
    return(this.submitSystemWorkflow);
  }

  public void setSubmitSystemWorkflow(String submitSystemWorkflow) {
    this.submitSystemWorkflow = submitSystemWorkflow;
  }

  public String getSysWorkflowCategoryID() {
    return(this.sysWorkflowCategoryID);
  }

  public void setSysWorkflowCategoryID(String sysWorkflowCategoryID) {
    this.sysWorkflowCategoryID = sysWorkflowCategoryID;
  }

  public String getWorkflowRecordID() {
    return(this.workflowRecordID);
  }

  public void setWorkflowRecordID(String workflowRecordID) {
    this.workflowRecordID = workflowRecordID;
  }

  public String getWorkflowComment() {
    return(this.workflowComment);
  }

  public void setWorkflowComment(String workflowComment) {
    this.workflowComment = workflowComment;
  }
  
  public String getFileNames() {
  	  return this.fileNames;
  }
  
  public void setFileNames(String fileNames) {
  	  this.fileNames = fileNames;
  }
  
  public String getDmsFileNames() {
  	  return this.dmsFileNames;
  }
  
  public void setDmsFileNames(String dmsFileNames) {
  	  this.dmsFileNames = dmsFileNames;
  }
  
  public String getDisplayFileNames() {
  	  return this.displayFileNames;
  }
  
  public void setDisplayFileNames(String displayFileNames){
  	  this.displayFileNames = displayFileNames;
  }
  
  public String getDisplayDmsFileNames() {
    	return this.displayDmsFileNames;
  }
  
  public void setDisplayDmsFileNames(String displayDmsFileNames){
    	this.displayDmsFileNames = displayDmsFileNames;
  }
  
  public String getReturnTo(){
    return this.returnTo;
  }
  
  public void setReturnTo(String returnTo){
    this.returnTo = returnTo;
  }
  
  public String getNextStepDueDates(){
    return this.nextStepDueDates;  
  }
  
  public void setNextStepDueDates(String nextStepDueDates) {
    this.nextStepDueDates = nextStepDueDates; 
  }
  
  public String getNextStepAllowAssignDueDate(){
    return this.nextStepAllowAssignDueDate;  
  }
  
  public void setNextStepAllowAssignDueDate(String nextStepAllowAssignDueDate){
    this.nextStepAllowAssignDueDate = nextStepAllowAssignDueDate;  
  }
  
  public String getCurStartRowNo() {
    return(this.curStartRowNo);
  }

  public void setCurStartRowNo(String curStartRowNo) {
    this.curStartRowNo = curStartRowNo;
  }

  public String getPageOffset() {
    return(this.pageOffset);
  }

  public void setPageOffset(String pageOffset) {
    this.pageOffset = pageOffset;
  }
  
  public String getSortAttribute() {
    return(this.sortAttribute);
  }

  public void setSortAttribute(String sortAttribute) {
    this.sortAttribute = sortAttribute;
  }

  public String getSortOrder() {
    return(this.sortOrder);
  }

  public void setSortOrder(String sortOrder) {
    this.sortOrder = sortOrder;
  }


  public void setFormFieldXmlFile(FormFile formFieldXmlFile) {
     this.formFieldXmlFile = formFieldXmlFile;
  }

  public FormFile getFormFieldXmlFile() {
    return formFieldXmlFile;
  }
  
  public void setCopiedDocID(Integer copiedDocID){
    this.copiedDocID = copiedDocID;
  }
  
  public Integer getCopiedDocID(){
    return this.copiedDocID;
  }

 public boolean getClearIndex(){
    return this.bClearIndex;
  }

  public void setClearIndex(boolean bClearIndex){
    this.bClearIndex=bClearIndex;
  }  


 public String getClearIndexFlag(){
    return this.clearIndexFlag;
  }

  public void setClearIndexFlag(String clearIndexFlag){
    this.clearIndexFlag=clearIndexFlag;
  }      
 
  public String getTrackID() {
  	return trackID;
  }
  
  public void setTrackID(String trackID) {
  	this.trackID = trackID;
  }
  
  public void setEditIndexFlag(String editIndexFlag) {
    this.editIndexFlag = editIndexFlag;
  }

  public String getEditIndexFlag() {
    return editIndexFlag;
  }

  public void setUseDefaultProfile(String useDefaultProfile) {
    this.useDefaultProfile = useDefaultProfile;
  }

  public String getUseDefaultProfile() {
    return useDefaultProfile;
  }  
  
  public String getInheritanceFlag() {
    return(this.inheritanceFlag);
  }

  public void setInheritanceFlag(String inheritanceFlag) {
    this.inheritanceFlag = inheritanceFlag;
  }  
  
  public String getObjectID() {
    return(this.objectID);
  }

  public void setObjectID(String objectID) {
    this.objectID = objectID;
  }

  public String getObjectType() {
    return(this.objectType);
  }

  public void setObjectType(String objectType) {
    this.objectType = objectType;
  }
  
  public String getPermission() {
    return(this.permission);
  }

  public void setPermission(String permission) {
    this.permission = permission;
  }
  
  public String getSetPermission() {
    return(this.setPermission);
  }

  public void setSetPermission(String setPermission) {
    this.setPermission = setPermission;
  }
  
  public String getErrorScanFormat() {
    return(this.errorScanFormat);
  }

  public void setErrorScanFormat(String errorScanFormat) {
    this.errorScanFormat = errorScanFormat;
  }
  
  public String getClientType() {
    return(this.clientType);
  }

  public void setClientType(String clientType) {
    this.clientType = clientType;
  }  
  
  
}

